<?php


class HuiyingModel extends BaseModel
{

    var $table  = 'huiying';	

    var $_page_rows = 20;	
	

    function show()
    {   
	
	      //分页时，一定是先调用page函数，再调用S_Sql_Exe函数
		 $info['page'] = $this->Page(array('conditions' =>"",'url' => 'admin/?app=huiying&act=index'));		
		 $info['data'] = $this->S_Sql_Exe(array('fields' =>'*','conditions' =>"",'order' =>'add_time desc','limit' =>$info['page']['sql_limit']));
    
		 return $info;
        
    }

    /* 删除数据 */
    function del($id ='')
    {      
		return $this->D_Sql_Exe(array ('conditions' =>"id = '{$id}' "));
        
    }


    /* 通过id取出一条数据 */
    function oneshow($id ='')
    {    
	      
		 $info = $this->S_Sql_Exe(array('fields' =>'*','conditions' =>"id='{$id}'",'return' =>'one'));
    
		 return $info;
        
    }

    /* 修改数据 */
    function editaction($user_id = '',$id ='',$data = '')
    {    
	    $time = time();
		return $this->IU_Sql_Exe(array ('data' => $data,'mode' => 'UPDATE','conditions' =>"id = '{$id}' "));
        
    }

}








?>